<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a{
            border:2px solid red;
            height: 4px;
        }
    </style>
</head>
<body>
    <!-- 块级元素独占一行，可以设置行高 -->
    <div style="border: 2px solid blue; ">块级元素占一行</div>
    <div class="a">块级元素占一行</div>
    <p class="a">块级占一行</p>
    <span class="a">行内元素</span>
    <a href="#" style="border: 2px solid red; width: 8px;">行内元素</a>
</body>
</html>